<h4><%= link_to _("Latest Warning/Error Tasks"), foreman_tasks_tasks_path(:order=>'started_at DESC') %></h4>
<table class="<%= table_css_classes('table-fixed') %>">
  <tr>
    <th class="col-md-5"><%= _("Name") %></th>
    <th class="col-md-2"><%= _("State") %></th>
    <th class="col-md-2"><%= _("Result") %></th>
    <th class="col-md-3"><%= _("Started") %></th>
  </tr>
  <% ForemanTasks::Task::Summarizer.new.latest_tasks_in_errors_warning.each do |task| %>
    <tr class="<%= ForemanTasks::Task::StatusExplicator.new.is_erroneous(task) ? 'text-danger' : '' %>">
      <td class="ellipsis"><%= link_to task.humanized[:action], defined?(main_app) ? main_app.foreman_tasks_task_path(task.id) : foreman_tasks_task_path(task.id) %></td>
      <td><%= task.state %></td>
      <td><%= task.result %></td>
      <td><%= task.started_at ? date_time_relative(task.started_at) : _('N/A') %></td>
    </tr>
  <% end %>
</table>
